CC = g++
LD = g++
prog = libnetwork.so
SRC = \
	blank_filetype.cpp \
	blank_filetype.h \
	blank_parser/parser.c \
	blank_parser/parser.h \
	configurator.h \
	connection_listener.cpp \
	connection_listener.h \
	connection_manager.cpp \
	connection_manager.h \
	filetype.h \
	generic_queue.h \
	i_socket.h \
	listener.h \
	network.h \
	notifier.h \
	notifier.cpp \
	parse_exception.h \
	parser.h \
	receiver.cpp \
	receiver.h \
	rs_socket.cpp \
	rs_socket.h \
	sender.h \
	tcp_socket.cpp \
	tcp_socket.h \
	thread_helper.h \
	worker_thread.h \
	worker_thread.cpp \
	xml_filetype.cpp \
	xml_filetype.h 

OBJ = \
	blank_filetype.o \
	blank_parser/parser.o \
	connection_listener.o \
	connection_manager.o \
	notifier.o \
	receiver.o \
	rs_socket.o \
	tcp_socket.o \
	worker_thread.o \
	xml_filetype.o 

LDFLAGS = -shared -L../model -Lsocket -lmodel -lboost_thread -lboost_regex -lsocket_cpp -lxml2 -L../core -lcore
CFLAGS = -std=c99 -g -fPIC -DPIC -fvar-tracking  -I/usr/include/libxml2 -I/usr/local/include

all: $(prog)

${prog}: $(OBJ)
	$(LD) $(LDFLAGS) $(OBJ) -o $(prog)

%.o: %.cpp
	$(CC) $(CFLAGS) -c $< -o $@

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm $(OBJ)
	rm $(prog)

run:
	./$(prog)
